using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class SEOrderMap : EntityTypeConfiguration<SEOrder>
    {
        public SEOrderMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FBrNo, t.FInterID });

            // Properties
            this.Property(t => t.FBrNo)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FInterID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FPayStyle)
                .HasMaxLength(30);

            this.Property(t => t.FFetchStyle)
                .HasMaxLength(30);

            this.Property(t => t.FFetchAdd)
                .HasMaxLength(255);

            this.Property(t => t.FNote)
                .HasMaxLength(30);

            this.Property(t => t.FPOOrdBillNo)
                .HasMaxLength(510);

            this.Property(t => t.FOperDate)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            this.Property(t => t.FCashDiscount)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FExplanation)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0143)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0144)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0145)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0146)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0147)
                .HasMaxLength(255);

            this.Property(t => t.FValidaterName)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0149)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0150)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0153)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0155)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0160)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0161)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0162)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0163)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0164)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0165)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0166)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0167)
                .HasMaxLength(255);

            this.Property(t => t.FHeadSelfS0157)
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("SEOrder");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FBillNo).HasColumnName("FBillNo");
            this.Property(t => t.FCurrencyID).HasColumnName("FCurrencyID");
            this.Property(t => t.FCustID).HasColumnName("FCustID");
            this.Property(t => t.FDate).HasColumnName("FDate");
            this.Property(t => t.FPayStyle).HasColumnName("FPayStyle");
            this.Property(t => t.FPayDate).HasColumnName("FPayDate");
            this.Property(t => t.FFetchStyle).HasColumnName("FFetchStyle");
            this.Property(t => t.FFetchDate).HasColumnName("FFetchDate");
            this.Property(t => t.FFetchAdd).HasColumnName("FFetchAdd");
            this.Property(t => t.FSaleStyle).HasColumnName("FSaleStyle");
            this.Property(t => t.FDeptID).HasColumnName("FDeptID");
            this.Property(t => t.FEmpID).HasColumnName("FEmpID");
            this.Property(t => t.FCheckerID).HasColumnName("FCheckerID");
            this.Property(t => t.FBillerID).HasColumnName("FBillerID");
            this.Property(t => t.FNote).HasColumnName("FNote");
            this.Property(t => t.FClosed).HasColumnName("FClosed");
            this.Property(t => t.FTranType).HasColumnName("FTranType");
            this.Property(t => t.FInvoiceClosed).HasColumnName("FInvoiceClosed");
            this.Property(t => t.FBClosed).HasColumnName("FBClosed");
            this.Property(t => t.FMangerID).HasColumnName("FMangerID");
            this.Property(t => t.FSettleID).HasColumnName("FSettleID");
            this.Property(t => t.FExchangeRate).HasColumnName("FExchangeRate");
            this.Property(t => t.FDiscountType).HasColumnName("FDiscountType");
            this.Property(t => t.FStatus).HasColumnName("FStatus");
            this.Property(t => t.FCancellation).HasColumnName("FCancellation");
            this.Property(t => t.FMultiCheckLevel1).HasColumnName("FMultiCheckLevel1");
            this.Property(t => t.FMultiCheckLevel2).HasColumnName("FMultiCheckLevel2");
            this.Property(t => t.FMultiCheckLevel3).HasColumnName("FMultiCheckLevel3");
            this.Property(t => t.FMultiCheckLevel4).HasColumnName("FMultiCheckLevel4");
            this.Property(t => t.FMultiCheckLevel5).HasColumnName("FMultiCheckLevel5");
            this.Property(t => t.FMultiCheckLevel6).HasColumnName("FMultiCheckLevel6");
            this.Property(t => t.FMultiCheckDate1).HasColumnName("FMultiCheckDate1");
            this.Property(t => t.FMultiCheckDate2).HasColumnName("FMultiCheckDate2");
            this.Property(t => t.FMultiCheckDate3).HasColumnName("FMultiCheckDate3");
            this.Property(t => t.FMultiCheckDate4).HasColumnName("FMultiCheckDate4");
            this.Property(t => t.FMultiCheckDate5).HasColumnName("FMultiCheckDate5");
            this.Property(t => t.FMultiCheckDate6).HasColumnName("FMultiCheckDate6");
            this.Property(t => t.FCurCheckLevel).HasColumnName("FCurCheckLevel");
            this.Property(t => t.FTransitAheadTime).HasColumnName("FTransitAheadTime");
            this.Property(t => t.FPOOrdBillNo).HasColumnName("FPOOrdBillNo");
            this.Property(t => t.FRelateBrID).HasColumnName("FRelateBrID");
            this.Property(t => t.FImport).HasColumnName("FImport");
            this.Property(t => t.FOrderAffirm).HasColumnName("FOrderAffirm");
            this.Property(t => t.FTranStatus).HasColumnName("FTranStatus");
            this.Property(t => t.FUUID).HasColumnName("FUUID");
            this.Property(t => t.FOperDate).HasColumnName("FOperDate");
            this.Property(t => t.FSystemType).HasColumnName("FSystemType");
            this.Property(t => t.FCashDiscount).HasColumnName("FCashDiscount");
            this.Property(t => t.FCheckDate).HasColumnName("FCheckDate");
            this.Property(t => t.FExplanation).HasColumnName("FExplanation");
            this.Property(t => t.FSettleDate).HasColumnName("FSettleDate");
            this.Property(t => t.FSelTranType).HasColumnName("FSelTranType");
            this.Property(t => t.FChildren).HasColumnName("FChildren");
            this.Property(t => t.FBrID).HasColumnName("FBrID");
            this.Property(t => t.FAreaPS).HasColumnName("FAreaPS");
            this.Property(t => t.FClassTypeID).HasColumnName("FClassTypeID");
            this.Property(t => t.FManageType).HasColumnName("FManageType");
            this.Property(t => t.FSysStatus).HasColumnName("FSysStatus");
            this.Property(t => t.FHeadSelfS0142).HasColumnName("FHeadSelfS0142");
            this.Property(t => t.FHeadSelfS0143).HasColumnName("FHeadSelfS0143");
            this.Property(t => t.FHeadSelfS0144).HasColumnName("FHeadSelfS0144");
            this.Property(t => t.FHeadSelfS0145).HasColumnName("FHeadSelfS0145");
            this.Property(t => t.FHeadSelfS0146).HasColumnName("FHeadSelfS0146");
            this.Property(t => t.FHeadSelfS0147).HasColumnName("FHeadSelfS0147");
            this.Property(t => t.FValidaterName).HasColumnName("FValidaterName");
            this.Property(t => t.FHeadSelfS0149).HasColumnName("FHeadSelfS0149");
            this.Property(t => t.FHeadSelfS0150).HasColumnName("FHeadSelfS0150");
            this.Property(t => t.FHeadSelfS0151).HasColumnName("FHeadSelfS0151");
            this.Property(t => t.FHeadSelfS0152).HasColumnName("FHeadSelfS0152");
            this.Property(t => t.FHeadSelfS0153).HasColumnName("FHeadSelfS0153");
            this.Property(t => t.FHeadSelfS0155).HasColumnName("FHeadSelfS0155");
            this.Property(t => t.FHeadSelfS0160).HasColumnName("FHeadSelfS0160");
            this.Property(t => t.FHeadSelfS0161).HasColumnName("FHeadSelfS0161");
            this.Property(t => t.FHeadSelfS0162).HasColumnName("FHeadSelfS0162");
            this.Property(t => t.FHeadSelfS0163).HasColumnName("FHeadSelfS0163");
            this.Property(t => t.FHeadSelfS0164).HasColumnName("FHeadSelfS0164");
            this.Property(t => t.FHeadSelfS0165).HasColumnName("FHeadSelfS0165");
            this.Property(t => t.FHeadSelfS0166).HasColumnName("FHeadSelfS0166");
            this.Property(t => t.FHeadSelfS0167).HasColumnName("FHeadSelfS0167");
            this.Property(t => t.FHeadSelfS0168).HasColumnName("FHeadSelfS0168");
            this.Property(t => t.FHeadSelfS0157).HasColumnName("FHeadSelfS0157");
        }
    }
}
